## API Report File for "@backstage/plugin-catalog-backend"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
/// <reference types="node" />

import { AnalyzeLocationEntityField as AnalyzeLocationEntityField_2 } from '@backstage/plugin-catalog-common';
import { AnalyzeLocationExistingEntity as AnalyzeLocationExistingEntity_2 } from '@backstage/plugin-catalog-common';
import { AnalyzeLocationGenerateEntity as AnalyzeLocationGenerateEntity_2 } from '@backstage/plugin-catalog-common';
import { AnalyzeLocationRequest as AnalyzeLocationRequest_2 } from '@backstage/plugin-catalog-common';
import { AnalyzeLocationResponse as AnalyzeLocationResponse_2 } from '@backstage/plugin-catalog-common';
import { AnalyzeOptions as AnalyzeOptions_2 } from '@backstage/plugin-catalog-node';
import { CatalogApi } from '@backstage/catalog-client';
import { CatalogCollatorEntityTransformer as CatalogCollatorEntityTransformer_2 } from '@backstage/plugin-search-backend-module-catalog';
import { CatalogEntityDocument } from '@backstage/plugin-catalog-common';
import { CatalogProcessor as CatalogProcessor_2 } from '@backstage/plugin-catalog-node';
import { CatalogProcessorCache as CatalogProcessorCache_2 } from '@backstage/plugin-catalog-node';
import { CatalogProcessorEmit as CatalogProcessorEmit_2 } from '@backstage/plugin-catalog-node';
import { CatalogProcessorEntityResult as CatalogProcessorEntityResult_2 } from '@backstage/plugin-catalog-node';
import { CatalogProcessorErrorResult as CatalogProcessorErrorResult_2 } from '@backstage/plugin-catalog-node';
import { CatalogProcessorLocationResult as CatalogProcessorLocationResult_2 } from '@backstage/plugin-catalog-node';
import { CatalogProcessorParser as CatalogProcessorParser_2 } from '@backstage/plugin-catalog-node';
import { CatalogProcessorRefreshKeysResult as CatalogProcessorRefreshKeysResult_2 } from '@backstage/plugin-catalog-node';
import { CatalogProcessorRelationResult as CatalogProcessorRelationResult_2 } from '@backstage/plugin-catalog-node';
import { CatalogProcessorResult as CatalogProcessorResult_2 } from '@backstage/plugin-catalog-node';
import { Config } from '@backstage/config';
import { DefaultCatalogCollatorFactory as DefaultCatalogCollatorFactory_2 } from '@backstage/plugin-search-backend-module-catalog';
import { DefaultCatalogCollatorFactoryOptions as DefaultCatalogCollatorFactoryOptions_2 } from '@backstage/plugin-search-backend-module-catalog';
import { DeferredEntity as DeferredEntity_2 } from '@backstage/plugin-catalog-node';
import { EntitiesSearchFilter as EntitiesSearchFilter_2 } from '@backstage/plugin-catalog-node';
import { Entity } from '@backstage/catalog-model';
import { EntityFilter as EntityFilter_2 } from '@backstage/plugin-catalog-node';
import { EntityPolicy } from '@backstage/catalog-model';
import { EntityProvider as EntityProvider_2 } from '@backstage/plugin-catalog-node';
import { EntityProviderConnection as EntityProviderConnection_2 } from '@backstage/plugin-catalog-node';
import { EntityProviderMutation as EntityProviderMutation_2 } from '@backstage/plugin-catalog-node';
import { EntityRelationSpec as EntityRelationSpec_2 } from '@backstage/plugin-catalog-node';
import { EventBroker } from '@backstage/plugin-events-node';
import { GetEntitiesRequest } from '@backstage/catalog-client';
import { LocationSpec as LocationSpec_2 } from '@backstage/plugin-catalog-common';
import { locationSpecToLocationEntity as locationSpecToLocationEntity_2 } from '@backstage/plugin-catalog-node';
import { locationSpecToMetadataName as locationSpecToMetadataName_2 } from '@backstage/plugin-catalog-node';
import { Logger } from 'winston';
import { Permission } from '@backstage/plugin-permission-common';
import { PermissionAuthorizer } from '@backstage/plugin-permission-common';
import { PermissionEvaluator } from '@backstage/plugin-permission-common';
import { PermissionRule } from '@backstage/plugin-permission-node';
import { PermissionRuleParams } from '@backstage/plugin-permission-common';
import { PlaceholderResolver as PlaceholderResolver_2 } from '@backstage/plugin-catalog-node';
import { PlaceholderResolverParams as PlaceholderResolverParams_2 } from '@backstage/plugin-catalog-node';
import { PlaceholderResolverRead as PlaceholderResolverRead_2 } from '@backstage/plugin-catalog-node';
import { PlaceholderResolverResolveUrl as PlaceholderResolverResolveUrl_2 } from '@backstage/plugin-catalog-node';
import { PluginDatabaseManager } from '@backstage/backend-common';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
import { PluginTaskScheduler } from '@backstage/backend-tasks';
import { Router } from 'express';
import { ScmIntegrationRegistry } from '@backstage/integration';
import { ScmLocationAnalyzer as ScmLocationAnalyzer_2 } from '@backstage/plugin-catalog-node';
import { TokenManager } from '@backstage/backend-common';
import { UrlReader } from '@backstage/backend-common';
import { Validators } from '@backstage/catalog-model';

// @public @deprecated
export type AnalyzeLocationEntityField = AnalyzeLocationEntityField_2;

// @public @deprecated
export type AnalyzeLocationExistingEntity = AnalyzeLocationExistingEntity_2;

// @public @deprecated
export type AnalyzeLocationGenerateEntity = AnalyzeLocationGenerateEntity_2;

// @public @deprecated (undocumented)
export type AnalyzeLocationRequest = AnalyzeLocationRequest_2;

// @public @deprecated (undocumented)
export type AnalyzeLocationResponse = AnalyzeLocationResponse_2;

// @public @deprecated (undocumented)
export type AnalyzeOptions = AnalyzeOptions_2;

// @public (undocumented)
export class AnnotateLocationEntityProcessor implements CatalogProcessor_2 {
  constructor(options: { integrations: ScmIntegrationRegistry });
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  preProcessEntity(
    entity: Entity,
    location: LocationSpec_2,
    _: CatalogProcessorEmit_2,
    originLocation: LocationSpec_2,
  ): Promise<Entity>;
}

// @public (undocumented)
export class AnnotateScmSlugEntityProcessor implements CatalogProcessor_2 {
  constructor(opts: {
    scmIntegrationRegistry: ScmIntegrationRegistry;
    kinds?: string[];
  });
  // (undocumented)
  static fromConfig(
    config: Config,
    options?: {
      kinds?: string[];
    },
  ): AnnotateScmSlugEntityProcessor;
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  preProcessEntity(entity: Entity, location: LocationSpec_2): Promise<Entity>;
}

// @public (undocumented)
export class BuiltinKindsEntityProcessor implements CatalogProcessor_2 {
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  postProcessEntity(
    entity: Entity,
    _location: LocationSpec_2,
    emit: CatalogProcessorEmit_2,
  ): Promise<Entity>;
  // (undocumented)
  validateEntityKind(entity: Entity): Promise<boolean>;
}

// @public (undocumented)
export const CATALOG_CONFLICTS_TOPIC = 'experimental.catalog.conflict';

// @public
export class CatalogBuilder {
  addEntityPolicy(
    ...policies: Array<EntityPolicy | Array<EntityPolicy>>
  ): CatalogBuilder;
  addEntityProvider(
    ...providers: Array<EntityProvider_2 | Array<EntityProvider_2>>
  ): CatalogBuilder;
  addLocationAnalyzers(
    ...analyzers: Array<ScmLocationAnalyzer_2 | Array<ScmLocationAnalyzer_2>>
  ): CatalogBuilder;
  addPermissionRules(
    ...permissionRules: Array<
      CatalogPermissionRuleInput | Array<CatalogPermissionRuleInput>
    >
  ): this;
  addProcessor(
    ...processors: Array<CatalogProcessor_2 | Array<CatalogProcessor_2>>
  ): CatalogBuilder;
  build(): Promise<{
    processingEngine: CatalogProcessingEngine;
    router: Router;
  }>;
  static create(env: CatalogEnvironment): CatalogBuilder;
  getDefaultProcessors(): CatalogProcessor_2[];
  replaceEntityPolicies(policies: EntityPolicy[]): CatalogBuilder;
  replaceProcessors(processors: CatalogProcessor_2[]): CatalogBuilder;
  setAllowedLocationTypes(allowedLocationTypes: string[]): CatalogBuilder;
  setEntityDataParser(parser: CatalogProcessorParser_2): CatalogBuilder;
  setEventBroker(broker: EventBroker): CatalogBuilder;
  setFieldFormatValidators(validators: Partial<Validators>): CatalogBuilder;
  setLocationAnalyzer(locationAnalyzer: LocationAnalyzer): CatalogBuilder;
  setPlaceholderResolver(
    key: string,
    resolver: PlaceholderResolver_2,
  ): CatalogBuilder;
  setProcessingInterval(
    processingInterval: ProcessingIntervalFunction,
  ): CatalogBuilder;
  setProcessingIntervalSeconds(seconds: number): CatalogBuilder;
  // (undocumented)
  subscribe(options: {
    onProcessingError: (event: {
      unprocessedEntity: Entity;
      errors: Error[];
    }) => Promise<void> | void;
  }): void;
  useLegacySingleProcessorValidation(): this;
}

// @public @deprecated (undocumented)
export type CatalogCollatorEntityTransformer =
  CatalogCollatorEntityTransformer_2;

// @public (undocumented)
export type CatalogEnvironment = {
  logger: Logger;
  database: PluginDatabaseManager;
  config: Config;
  reader: UrlReader;
  permissions: PermissionEvaluator | PermissionAuthorizer;
  scheduler?: PluginTaskScheduler;
};

// @public
export type CatalogPermissionRuleInput<
  TParams extends PermissionRuleParams = PermissionRuleParams,
> = PermissionRule<Entity, EntitiesSearchFilter_2, 'catalog-entity', TParams>;

// @public
export interface CatalogProcessingEngine {
  // (undocumented)
  start(): Promise<void>;
  // (undocumented)
  stop(): Promise<void>;
}

// @public @deprecated (undocumented)
export type CatalogProcessor = CatalogProcessor_2;

// @public @deprecated (undocumented)
export type CatalogProcessorCache = CatalogProcessorCache_2;

// @public @deprecated (undocumented)
export type CatalogProcessorEmit = CatalogProcessorEmit_2;

// @public @deprecated (undocumented)
export type CatalogProcessorEntityResult = CatalogProcessorEntityResult_2;

// @public @deprecated (undocumented)
export type CatalogProcessorErrorResult = CatalogProcessorErrorResult_2;

// @public @deprecated (undocumented)
export type CatalogProcessorLocationResult = CatalogProcessorLocationResult_2;

// @public @deprecated (undocumented)
export type CatalogProcessorParser = CatalogProcessorParser_2;

// @public @deprecated (undocumented)
export type CatalogProcessorRefreshKeysResult =
  CatalogProcessorRefreshKeysResult_2;

// @public @deprecated (undocumented)
export type CatalogProcessorRelationResult = CatalogProcessorRelationResult_2;

// @public @deprecated (undocumented)
export type CatalogProcessorResult = CatalogProcessorResult_2;

// @public (undocumented)
export class CodeOwnersProcessor implements CatalogProcessor_2 {
  constructor(options: {
    integrations: ScmIntegrationRegistry;
    logger: Logger;
    reader: UrlReader;
  });
  // (undocumented)
  static fromConfig(
    config: Config,
    options: {
      logger: Logger;
      reader: UrlReader;
    },
  ): CodeOwnersProcessor;
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  preProcessEntity(entity: Entity, location: LocationSpec_2): Promise<Entity>;
}

// @public
export function createRandomProcessingInterval(options: {
  minSeconds: number;
  maxSeconds: number;
}): ProcessingIntervalFunction;

// @public @deprecated (undocumented)
export class DefaultCatalogCollator {
  constructor(options: {
    discovery: PluginEndpointDiscovery;
    tokenManager: TokenManager;
    locationTemplate?: string;
    filter?: GetEntitiesRequest['filter'];
    catalogClient?: CatalogApi;
  });
  // (undocumented)
  protected applyArgsToFormat(
    format: string,
    args: Record<string, string>,
  ): string;
  // (undocumented)
  protected readonly catalogClient: CatalogApi;
  // (undocumented)
  protected discovery: PluginEndpointDiscovery;
  // (undocumented)
  execute(): Promise<CatalogEntityDocument[]>;
  // (undocumented)
  protected filter?: GetEntitiesRequest['filter'];
  // (undocumented)
  static fromConfig(
    _config: Config,
    options: {
      discovery: PluginEndpointDiscovery;
      tokenManager: TokenManager;
      filter?: GetEntitiesRequest['filter'];
    },
  ): DefaultCatalogCollator;
  // (undocumented)
  protected locationTemplate: string;
  // (undocumented)
  protected tokenManager: TokenManager;
  // (undocumented)
  readonly type: string;
  // (undocumented)
  readonly visibilityPermission: Permission;
}

// @public @deprecated (undocumented)
export const defaultCatalogCollatorEntityTransformer: CatalogCollatorEntityTransformer_2;

// @public @deprecated (undocumented)
export const DefaultCatalogCollatorFactory: typeof DefaultCatalogCollatorFactory_2;

// @public @deprecated (undocumented)
export type DefaultCatalogCollatorFactoryOptions =
  DefaultCatalogCollatorFactoryOptions_2;

// @public @deprecated (undocumented)
export type DeferredEntity = DeferredEntity_2;

// @public @deprecated (undocumented)
export type EntitiesSearchFilter = EntitiesSearchFilter_2;

// @public @deprecated (undocumented)
export type EntityFilter = EntityFilter_2;

// @public @deprecated (undocumented)
export type EntityProvider = EntityProvider_2;

// @public @deprecated (undocumented)
export type EntityProviderConnection = EntityProviderConnection_2;

// @public @deprecated (undocumented)
export type EntityProviderMutation = EntityProviderMutation_2;

// @public @deprecated (undocumented)
export type EntityRelationSpec = EntityRelationSpec_2;

// @public (undocumented)
export class FileReaderProcessor implements CatalogProcessor_2 {
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  readLocation(
    location: LocationSpec_2,
    optional: boolean,
    emit: CatalogProcessorEmit_2,
    parser: CatalogProcessorParser_2,
  ): Promise<boolean>;
}

// @public (undocumented)
export type LocationAnalyzer = {
  analyzeLocation(
    location: AnalyzeLocationRequest_2,
  ): Promise<AnalyzeLocationResponse_2>;
};

// @public @deprecated
export class LocationEntityProcessor implements CatalogProcessor_2 {
  constructor(options: LocationEntityProcessorOptions);
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  postProcessEntity(
    entity: Entity,
    location: LocationSpec_2,
    emit: CatalogProcessorEmit_2,
  ): Promise<Entity>;
}

// @public @deprecated (undocumented)
export type LocationEntityProcessorOptions = {
  integrations: ScmIntegrationRegistry;
};

// @public @deprecated
export type LocationSpec = LocationSpec_2;

// @public @deprecated (undocumented)
export const locationSpecToLocationEntity: typeof locationSpecToLocationEntity_2;

// @public @deprecated (undocumented)
export const locationSpecToMetadataName: typeof locationSpecToMetadataName_2;

// @public (undocumented)
export function parseEntityYaml(
  data: Buffer,
  location: LocationSpec_2,
): Iterable<CatalogProcessorResult_2>;

// @public
export class PlaceholderProcessor implements CatalogProcessor_2 {
  constructor(options: PlaceholderProcessorOptions);
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  preProcessEntity(
    entity: Entity,
    location: LocationSpec_2,
    emit: CatalogProcessorEmit_2,
  ): Promise<Entity>;
}

// @public (undocumented)
export type PlaceholderProcessorOptions = {
  resolvers: Record<string, PlaceholderResolver_2>;
  reader: UrlReader;
  integrations: ScmIntegrationRegistry;
};

// @public @deprecated (undocumented)
export type PlaceholderResolver = PlaceholderResolver_2;

// @public @deprecated (undocumented)
export type PlaceholderResolverParams = PlaceholderResolverParams_2;

// @public @deprecated (undocumented)
export type PlaceholderResolverRead = PlaceholderResolverRead_2;

// @public @deprecated (undocumented)
export type PlaceholderResolverResolveUrl = PlaceholderResolverResolveUrl_2;

// @public
export type ProcessingIntervalFunction = () => number;

// @public @deprecated (undocumented)
export const processingResult: Readonly<{
  readonly notFoundError: (
    atLocation: LocationSpec_2,
    message: string,
  ) => CatalogProcessorResult_2;
  readonly inputError: (
    atLocation: LocationSpec_2,
    message: string,
  ) => CatalogProcessorResult_2;
  readonly generalError: (
    atLocation: LocationSpec_2,
    message: string,
  ) => CatalogProcessorResult_2;
  readonly location: (newLocation: LocationSpec_2) => CatalogProcessorResult_2;
  readonly entity: (
    atLocation: LocationSpec_2,
    newEntity: Entity,
  ) => CatalogProcessorResult_2;
  readonly relation: (spec: EntityRelationSpec_2) => CatalogProcessorResult_2;
  readonly refresh: (key: string) => CatalogProcessorResult_2;
}>;

// @public @deprecated (undocumented)
export type ScmLocationAnalyzer = ScmLocationAnalyzer_2;

// @public
export function transformLegacyPolicyToProcessor(
  policy: EntityPolicy,
): CatalogProcessor_2;

// @public (undocumented)
export class UrlReaderProcessor implements CatalogProcessor_2 {
  constructor(options: { reader: UrlReader; logger: Logger });
  // (undocumented)
  getProcessorName(): string;
  // (undocumented)
  readLocation(
    location: LocationSpec_2,
    optional: boolean,
    emit: CatalogProcessorEmit_2,
    parser: CatalogProcessorParser_2,
    cache: CatalogProcessorCache_2,
  ): Promise<boolean>;
}
```
